How can give privilege for DB to a user [ ERROR 1044 (42000): Access denied for user ''@'localhost']

Posted by Ahn on Server Fault See other posts from Server Fault or by Ahn
Published on 2012-07-04T06:32:16Z Indexed on 2012/07/05 21:18 UTC
Read the original article Hit count: 221

Filed under:

I have created user in mysql 5.1 and given the ALL privilege, details given below,

mysql> show GRANTS FOR test;
+-------------------------------------------------------------+
| Grants for test@%                                           |
+-------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'test'@'%' WITH GRANT OPTION |
| GRANT ALL PRIVILEGES ON `tt`.* TO 'test'@'%'                |
+-------------------------------------------------------------+
2 rows in set (0.00 sec)

But the show databases is not showing the databases on the mysql. It only shows as given below. How can give privilege for other DB s tables as well for the user 'test'?

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| test               |
+--------------------+

Error while I tried to use the mysql DB as user test:

mysql> use mysql;
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'

© Server Fault or respective owner

Related posts about mysql